
public class Aufgabe2 {

	static class Singleton {
		 
		  private static Singleton instance;

		  private Singleton () {}

		  public static Singleton getInstance () {
		    if (Singleton.instance == null) {
		      Singleton.instance = new Singleton ();
		    }
		    return Singleton.instance;
		  }
		}
	
	public static void main(String[] args) {
		Singleton a=Singleton.getInstance();
		Singleton b=Singleton.getInstance();
		if (a == b) System.out.println("Objekte sind gleich");
	}

}
